Skip to content

Fix NIC e2e test flake in safari#3198

Merged
david-crespo merged 1 commit intomainfrom
fix-safari-nic-e2e
Apr 23, 2026
Merged

Fix NIC e2e test flake in safari#3198
david-crespo merged 1 commit intomainfrom
fix-safari-nic-e2e

Conversation

@david-crespo
Copy link
Copy Markdown
Collaborator

Test failure in #3195 repros locally no problem:

image

Claude's speculation on why it suddenly became a problem after #3178 is good enough for me. This is the second or third time lately we've run into small issues because we're not awaiting queryClient.invalidateEndpoint in the mutation handlers. Something to keep an eye on.

The race: NetworkingTab gates the Delete row action on nic.primary && multipleNics, where multipleNics = nics.length > 1. When the my-nic delete mutation succeeds, onSuccess synchronously calls queryClient.invalidateEndpoint (not awaited) and closes the confirm modal. If the test opens nic-3's row-actions menu before the refetch lands, nics.length is still 2, so Delete renders disabled and wrapped in a <Wrap with={<Tooltip/>}>. When the refetch then lands mid-click, the <Wrap> unwraps, the Menu.Item remounts (old DOM detached), and on Safari/Firefox base-ui's Menu treats that focus/DOM churn as a close — so Playwright's retry never resolves a clickable Delete and hits the 60s timeout.

When it was introduced: the disable rule landed April 2025 in #2806 ("Disable primary NIC delete when multiple NICs present"). The DropdownMenu.Item <Wrap>-with-Tooltip pattern has been in place since ~March 2025. So the race has been latent for about a year.

Why it's surfacing now: first CI appearance was on the #3178 "Responsive grid layout" PR (2026-04-21), which landed on trunk 2026-04-22; every workflow run after that hits it. #3178 moved TopBar/Sidebar from CSS-grid cells to fixed-position elements, switched to document-level scroll, removed overflow-y-hidden on body, and set height: 100% on html/body/#root. None of that touches the NIC flow, but it changed paint/layout timing around modal open/close and table reflow. That shifted the window such that expect(my-nic cell).toBeHidden() now reliably resolves while the page is briefly inert during the modal's close transition — before the refetch has actually landed — so the test races into opening nic-3's menu in the stale state. The layout PR didn't introduce the bug; it just removed the timing cushion that had been hiding it.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
console Ready Ready Preview Apr 23, 2026 6:25pm

Request Review

@david-crespo david-crespo enabled auto-merge (squash) April 23, 2026 18:25
@david-crespo david-crespo merged commit a2773c4 into main Apr 23, 2026
7 checks passed
@david-crespo david-crespo deleted the fix-safari-nic-e2e branch April 23, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant